﻿namespace nnp7ChatDemo
{
    /// <summary>
    /// 表情数据包
    /// </summary>
    public class EmojiPkg
    {
        public EmojiPkg()
        {
        }

        public EmojiPkg(EmojiType emoji, string name)
        {
            Emoji = emoji;
            Name = name;
            Time = DateTime.Now;
        }

        public EmojiType Emoji { get; set; }

        public string Name { get; set; }

        public DateTime Time { get; set; }

        public enum EmojiType
        {
            笑脸, 红心
        }

        public override string ToString()
        {
            string emo = "";
            switch (Emoji)
            {
                case EmojiType.笑脸:
                    emo = "\U0001F600";
                    break;
                case EmojiType.红心:
                    emo = "\u2764\uFE0F";
                    break;
            }
            return $"[{Name}(表情) {Time.ToString("HH:mm")}]:{emo}";
        }
    }

}
